<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <meta name="description" content="" />
    <meta name="referrer" content="no-referrer" />
    <meta
      name="description"
      content="汇融名企是面向全国商家服务的大型互联网平台，为商家提供流量扶持，引导品牌曝光；为消费者提供风云榜单，招商加盟，引导实现消费，达成合作，上汇融名企实现共赢。"
    />
    <title>项目招标-汇融名企</title>
    <link rel="stylesheet" href="./css/common.css" />
    <link rel="stylesheet" href="./css/carousel.css" />
    <link rel="stylesheet" href="./css/project-bidding.css" />
  </head>
  <body>
    <!-- <div id="header-page"></div> -->
    <!--#include virtual="/header.html" -->
    <div class="banner-top-line"></div>
    <div class="top-carousel">
        <div class="pb-carouselWarp carousel carousel-banner">
          <ul class="pb-carousel" id="banner-1"></ul>
          <ul class="pb-carousel-ind" id="banner-1-point"></ul>
        </div>
    </div>
    <div class="wrapper">
      <div class="project-bidding-bottom" style="margin-top: 56px;">
        <div class="tender-con">
          <div class="project-title">
            <h1><i class="title-icon1"></i>公司动态</h1>
            <a href="tenderingList.html">更多</a>
          </div>
          <ul class="project-ul con-ul" id="companyDynamic"></ul>
        </div>
        <div class="tender-con">
          <div class="project-title">
            <h1><i class="title-icon2"></i>招标推荐</h1>
            <a href="tenderingList.html">更多</a>
          </div>
          <ul class="project-ul con-ul" id="tenderRecommended"></ul>
        </div>
        <div class="tender-con" style="margin-right: 0;">
          <div class="project-title">
            <h1><i class="title-icon3"></i>项目推荐</h1>
            <a href="tenderingList.html">更多</a>
          </div>
          <ul class="project-ul con-ul" id="projectRecommend"></ul>
        </div>
        <img src="./image/banner/home_picture.png" class="project-top-img" />
        <div class="tender-con" style="margin-right: 0; height: 455px;">
          <div class="tender-con-child inline-block">
            <div class="project-title2">
              <h1>供应商推荐</h1>
            </div>
            <ul class="project-ul2" id="supplierRecommendation"></ul>
          </div>
          <div class="tender-con-child inline-block" style="margin-left: -5px; width: 243px;">
            <div class="project-title2">
              <h1>招标机构</h1>
              <a href="tenderingList.html">更多</a>
            </div>
            <ul class="project-ul2" id="tender"></ul>
          </div>
        </div>
      </div>
      <div class="slider wrapper">
        <div class="arrow-container  arrow-left left" id="slider-left"></div>
        <div class="arrow-container  arrow-right right" id="slider-right"></div>
        <div class="slider-container">
          <div class="silider-box">
            <ul class="slider-item-container" id="slider-item-container"></ul>
          </div>
        </div>
        <div class="clear"></div>
      </div>
      <div class="project-bidding-bottom">
        <div class="title" style="margin:20px 0 36px">
          <div style="position: relative">
            <img src="./image/picture/home_title.png" alt="" />
            <div class="title-more">
              <a href="./merchantsJoin.html"> MORE <span>></span></a>
            </div>
          </div>
          <div class="title-divider-wrapper">
            <div class="title-divider-colorbar"></div>
            <div class="title-divider"></div>
          </div>
        </div>
        <div class="tender-con">
          <div class="project-title">
            <h1><i class="title-icon4"></i><span>招标公告</span></h1>
            <a class="project-more">更多</a>
          </div>
          <ul class="project-ul con-ul" id="tenderAnnouncement"></ul>
        </div>
        <div class="tender-con">
          <div class="project-title">
            <h1><i class="title-icon5"></i> <span>招标预告</span></h1>
            <a class="project-more">更多</a>
          </div>
          <ul class="project-ul con-ul" id="tenderNotice"></ul>
        </div>
        <div class="tender-con" style="margin-right: 0;">
          <div class="project-title">
            <h1><i class="title-icon6"></i> <span>中标公告</span> </h1>
            <a class="project-more" >更多</a>
          </div>
          <ul class="project-ul con-ul" id="biddingNotice"></ul>
        </div>
        <div class="tender-con">
          <div class="project-title">
            <h1><i class="title-icon7"></i> <span>招标变更</span></h1>
            <a class="project-more">更多</a>
          </div>
          <ul class="project-ul con-ul" id="winningNotice"></ul>
        </div>
        <div class="project-middle">
          <img src="./image/banner/home_banner.png"/>
          <div class="project-middle-img"></div>
        </div>
      </div>
      
      <div class="project-bidding-bottom">
        <div class="bottom-con">
          <h1 class="title1">合作单位</h1>
          <div class="cooperation"></div>
        </div>
        <div class="bottom-con">
          <h1 class="title2">招标公司</h1>
          <div class="bidding-company"></div>
        </div>
        <div class="bottom-con" style="margin-right: 0;">
          <h1 class="title3">供应求购</h1>
          <div class="forsupply"></div>
        </div>
      </div>
    </div>
    </div>
    <!-- #include virtual="/footer.html" -->
    <!-- <div id="footer-page"></div> -->
  <script src="./js/jquery-1.11.0.min.js"></script>
  <script src="./js/jquery.my-message.1.1.js"></script>
  <script src="./js/utils.js"></script>
  <script src="./js/api.js"></script>
  <script src="./js/carousel.min.js"></script>
  <script src="./js/homeImages.js"></script>
  <script type="text/javascript">
    $(function() {
      // $('#header-page').load('header.html')
      // $('#footer-page').load('footer.html')
      var api = new ajax('GET', '/api/tendInfo/project')
      api.then(function(res) {
        init(JSON.parse(res).data)
      })
    })
    function init(data) {
      var windowWidth = $('body').width()
      $('.carousel-banner').css('height', (558 / 1920) * windowWidth + 'px')
      window.onresize = function() {
        var windowWidth = $('body').width()
        $('.carousel-banner').css('height', (558 / 1920) * windowWidth + 'px')
      }

      initTopCarousel(homeBannerImg, $('.top-carousel'))
      initCompanyDynamic(data.companyNews, $('#companyDynamic'))
      initCompanyDynamic(data.inviteTend, $('#tenderRecommended'))
      initCompanyDynamic(data.inviteProject, $('#projectRecommend'))
      initTender(data.inviteSupplier, $('#supplierRecommendation'))
      initTender(data.tenderOrgan, $('#tender'))

      initCompanyDynamic(data.tenderNotice, $('#tenderAnnouncement'))
      initCompanyDynamic(data.tenderHerald, $('#tenderNotice'))
      initCompanyDynamic(data.tenderChange, $('#biddingNotice'))
      initCompanyDynamic(data.tenderWinning, $('#winningNotice'))
      // 底部图片
      initProjectMiddleImg(projectMiddleImgData,$('.project-middle-img'))
      initCooperation(cooperationData,$('.cooperation'))
      initBiddingCompany(biddingCompanyData,$('.bidding-company'))
      initForsupply(forsupplyData,$('.forsupply'))
      $('.project-more').click(function() {
        sessionStorage.setItem('projectType',$(this).parent().find('h1 span').html())
        go('tenderingList.html')
      })
      //横向滚动展示
      // 赋值
      initSliderItem(sliderItemData,$('#slider-item-container'))
      var leftTimer = ''
      $('#slider-left').click(function() {
        if (!leftTimer) {
          var left = $('#slider-item-container')
            .css('left')
            .split('px')[0]
          left -= 275
          leftTimer = $('#slider-item-container').animate(
            {left: left + 'px'},
            200,
            function() {
              leftTimer = ''
              var el = $('#slider-item-container').children().eq(0).html()
              $('#slider-item-container').append( '<li>'+el+'</li>')
              $('#slider-item-container').children().eq(0).remove()
              $('#slider-item-container').css('left',0)
            }
          )
        }
      })
      var rightTimer = ''
      $('#slider-right').click(function() {
        if (!rightTimer) {
          var last = $('#slider-item-container').children().length -1
          var el = $('#slider-item-container').children().eq(last).html()
          $('#slider-item-container').prepend( '<li>'+el+'</li>')
          $('#slider-item-container').css('left','-275px')
          rightTimer = $('#slider-item-container').animate(
            {left: 0 + 'px'},
            200,
            function() {
              rightTimer = ''
              $('#slider-item-container').children().eq(last+1).remove()
            }
          )
        }
      })
    }
    function initCompanyDynamic(data, parent) {
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
          ' <li>' +
          '                <a href="tenderDetails.html?id='+currentData.tend_id+'">' +
          '              <p class="need-text-overflow">' +
          
          currentData.entry_name +
          '              </p>' +
          '              <div class="right time">' +
            getDate(currentData.release_time) +
          '</div>' +
          '</a>' +
          '            </li>'
      }
      parent.append(item)
    }
    function initTender(data, parent) {
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
          ' <li>' +
          '                <a href="tenderDetails.html?id='+currentData.tend_id+'">' +
          '              <p class="need-text-overflow">' +
          
          currentData.entry_name +
          '              </p>' +
          '</div>' +
          '</a>' +
          '            </li>'
      }
      parent.append(item)
    }
    function initTenderList(data, parent) {
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
          '<li style="background:' +
          (i % 2 == 0 ? '' : '#F6F7FA') +
          '">' +
          '              <a href="#">' +
          '                <i class="rank-icon' +
          (+i + 1) +
          '">' +
          (i > 2 ? +i + 1 : '') +
          '</img>' +
          '                <p class="need-text-overflow">' +
          currentData.title +
          '                </p></a' +
          '              >' +
          '            </li>'
      }
      parent.append(item)
    }
    function initProjectMiddleImg(data, parent){
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
          '<a target="_blank" href="'+ currentData.url+'"><img style="margin-right:' +
          (i != 0 && (+i + 1) % 5 == 0 ? '0' : '') +
          '" src="'+currentData.images +'"/></a>'
      }
      parent.append(item)
    }
    function initCooperation(data, parent){
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
          '<a target="_blank" href="'+ currentData.url+'"><img class="tender-img" style="margin-right:' +
          (i != 0 && (+i + 1) % 2 == 0 ? '0' : '12px') +
          '" src="'+currentData.images +'"/></a>'
      }
      parent.append(item)
    }
    function initBiddingCompany(data, parent){
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
        '              <a style="margin-right:' +
          (i != 0 && (+i + 1) % 3 == 0 ? '0' : '') +
          '">'+
        '              <img src="'+currentData.images +'"/>'+
        '            </a>';
      }
      parent.append(item)
    }
    function initForsupply(data, parent){
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
        '              <a style="margin-right:' +
          (i != 0 && (+i + 1) % 3 == 0 ? '0' : '') +
          '">'+
        '              <img src="'+currentData.images +'"/>'+
        '            </a>';
      }
      parent.append(item)
    } 
    function initSliderItem(data, parent){
      var item = ''
      for (var i in data) {
        var currentData = data[i]
        item +=
        '<li><div class="slider-item"><a target="_blank" href="'+currentData.url+'"><img src="'+currentData.images+'"/></a></div></li>';
      }
      parent.append(item)
    }
  </script>
  </body>
</html>
